home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / minix / up1510b.tgz / up1510b / src / fs / table.c < prev    next >
C/C++ Source or Header  |  1990-07-23  |  4KB  |  117 lines

  1. /* This file contains the table used to map system call numbers onto the
  2.  * routines that perform them.
  3.  */
  4.  
  5. #define _TABLE
  6.  
  7. #include "fs.h"
  8. #include <sys/stat.h>
  9.  
  10. #include <minix/callnr.h>
  11. #include <minix/com.h>
  12. #include "buf.h"
  13. #include "dev.h"
  14. #include "file.h"
  15. #include "fproc.h"
  16. #include "inode.h"
  17. #include "super.h"
  18.  
  19. PUBLIC char *stackpt = &fstack[FS_STACK_BYTES];    /* initial stack pointer */
  20.  
  21. PUBLIC int (*call_vector[NCALLS])() = {
  22.     no_sys,        /*  0 = unused    */
  23.     do_exit,    /*  1 = exit    */
  24.     do_fork,    /*  2 = fork    */
  25.     do_read,    /*  3 = read    */
  26.     do_write,    /*  4 = write    */
  27.     do_open,    /*  5 = open    */
  28.     do_close,    /*  6 = close    */
  29.     no_sys,        /*  7 = wait    */
  30.     do_creat,    /*  8 = creat    */
  31.     do_link,    /*  9 = link    */
  32.     do_unlink,    /* 10 = unlink    */
  33.     no_sys,        /* 11 = exec    */
  34.     do_chdir,    /* 12 = chdir    */
  35.     do_time,    /* 13 = time    */
  36.     do_mknod,    /* 14 = mknod    */
  37.     do_chmod,    /* 15 = chmod    */
  38.     do_chown,    /* 16 = chown    */
  39.     no_sys,        /* 17 = break    */
  40.     do_stat,    /* 18 = stat    */
  41.     do_lseek,    /* 19 = lseek    */
  42.     no_sys,        /* 20 = getpid    */
  43.     do_mount,    /* 21 = mount    */
  44.     do_umount,    /* 22 = umount    */
  45.     do_set,        /* 23 = setuid    */
  46.     no_sys,        /* 24 = getuid    */
  47.     do_stime,    /* 25 = stime    */
  48.     no_sys,        /* 26 = (ptrace)*/
  49.     no_sys,        /* 27 = alarm    */
  50.     do_fstat,    /* 28 = fstat    */
  51.     no_sys,        /* 29 = pause    */
  52.     do_utime,    /* 30 = utime    */
  53.     no_sys,        /* 31 = (stty)    */
  54.     no_sys,        /* 32 = (gtty)    */
  55.     do_access,    /* 33 = access    */
  56.     no_sys,        /* 34 = (nice)    */
  57.     no_sys,        /* 35 = (ftime)    */
  58.     do_sync,    /* 36 = sync    */
  59.     no_sys,        /* 37 = kill    */
  60.     do_rename,    /* 38 = rename    */
  61.     do_mkdir,    /* 39 = mkdir    */
  62.     do_unlink,    /* 40 = rmdir    */
  63.     do_dup,        /* 41 = dup    */
  64.     do_pipe,    /* 42 = pipe    */
  65.     do_tims,    /* 43 = times    */
  66.     no_sys,        /* 44 = (prof)    */
  67.     no_sys,        /* 45 = unused    */
  68.     do_set,        /* 46 = setgid    */
  69.     no_sys,        /* 47 = getgid    */
  70.     no_sys,        /* 48 = sig    */
  71.     no_sys,        /* 49 = unused    */
  72.     no_sys,        /* 50 = unused    */
  73.     no_sys,        /* 51 = (acct)    */
  74.     no_sys,        /* 52 = (phys)    */
  75.     no_sys,        /* 53 = (lock)    */
  76.     do_ioctl,    /* 54 = ioctl    */
  77.     do_fcntl,    /* 55 = fcntl    */
  78.     no_sys,        /* 56 = (mpx)    */
  79.     no_sys,        /* 57 = unused    */
  80.     no_sys,        /* 58 = unused    */
  81.     no_sys,        /* 59 = exece    */
  82.     do_umask,    /* 60 = umask    */
  83.     do_chroot,    /* 61 = chroot    */
  84.     no_sys,        /* 62 = unused    */
  85.     no_sys,        /* 63 = unused    */
  86.  
  87.     no_sys,        /* 64 = KSIG: signals originating in the kernel    */
  88.     do_unpause,    /* 65 = UNPAUSE    */
  89.     no_sys,     /* 66 = BRK2 (used to tell MM size of FS,INIT)    */
  90.     do_revive,    /* 67 = REVIVE    */
  91.     no_sys,        /* 68 = TASK_REPLY    */
  92.     no_sys,        /* 69 = unused */
  93. };
  94.  
  95.  
  96. /* The order of the entries here determines the mapping between major device
  97.  * numbers and tasks.  The first entry (major device 0) is not used.  The
  98.  * next entry is major device 1, etc.  Character and block devices can be
  99.  * intermixed at random.  If this ordering is changed, the devices in h/boot.h
  100.  * must be changed to correspond to the new values.  Note that the major
  101.  * device numbers used in /dev are NOT the same as the task numbers used
  102.  * inside the kernel (as defined in h/com.h).
  103.  */
  104. PUBLIC struct dmap dmap[] = {
  105. /*  Open       Read/Write   Close       Task #      Device  File
  106.     ----       ----------   -----       -------     ------  ----      */
  107.     0,         0,           0,          0,           /* 0 = not used  */
  108.     no_call,   rw_dev,      no_call,    MEM,         /* 1 = /dev/mem  */
  109.     no_call,   rw_dev,      no_call,    FLOPPY,      /* 2 = /dev/fd0  */
  110.     no_call,   rw_dev,      no_call,    WINCHESTER,  /* 3 = /dev/hd0  */
  111.     tty_open,  rw_dev,      no_call,    TTY,         /* 4 = /dev/tty0 */
  112.     no_call,   rw_dev2,     no_call,    TTY,         /* 5 = /dev/tty  */
  113.     no_call,   rw_dev,      no_call,    PRINTER,     /* 6 = /dev/lp   */
  114. };
  115.  
  116. PUBLIC int max_major = sizeof(dmap)/sizeof(struct dmap);
  117.